var path = "http://127.0.0.1:8081/recruit/"
//通用ajax的表单post请求
function ajaxPost(formName, address){
	var d = {};
    var t = $(formName).serializeArray();
	var data= {}
    //t的值为[{name: "a1", value: "xx"},
    //{name: "a2", value: "xx"}...]
    $.each(t, function() {
      d[this.name] = this.value;
    });
	console.log($(formName).serializeArray());
	$.ajax({ 
    type:'post',  
    url:path+address, 
    async: false,
    data:$(formName).serializeArray(),  //重点必须为一个变量如：data
    dataType:'json', 
	crossDomain: true,
	xhrFields: {
		withCredentials: true
	},
    success:function(da){    
		//alert(da.msg+"data数据")
		data = da
		
    },
    error:function(){ 
     alert("请求失败")
    }
   })
	return data;
}






